package com.tledu.zyf.servlet.group;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tledu.zyf.model.Group;
import com.tledu.zyf.util.ObjectFactory;

@WebServlet("/group/add")
public class GroupAddServlet extends HttpServlet {
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// 获取传递的数据
		String groupname = request.getParameter("groupname");
		String introduce = request.getParameter("introduce");
		Group group = new Group(groupname, introduce);
		// System.out.println(user);
		ObjectFactory.getGroupService().add(group);
	}
}
